function makePagingControl(targetObj, page, total, count, callback) {
    var html = "";

    var st = Math.floor((page - 1) / count) * count + 1;
    var ed= st + count - 1;

    if (total == 0) {
        html = "&nbsp;";
    } else {
        html += "<img id=\"btn_go_first\"     class=\"paging-button\" src=\"/resource/images/community-button-paging-first.gif\" />&nbsp;&nbsp;&nbsp;";
        html += "<img id=\"btn_go_prev_page\" class=\"paging-button\" src=\"/resource/images/community-button-paging-prev-page.gif\" />&nbsp;";
        html += "<img id=\"btn_go_prev\"      class=\"paging-button\" src=\"/resource/images/community-button-paging-prev.gif\" />";
        html += "&nbsp;&nbsp;&nbsp;";
        html += "<span>";

        for (var i = st; i <= Math.min(ed, total); i++) {
            if (i != st) {
                html += "&nbsp;&nbsp;<img src=\"/resource/images/community-button-paging-dot.gif\" style=\"vertical-align: middle;\" />&nbsp;&nbsp;";
            }

            html += "<a href=\"#\" id=\"btn_go_" + i + "\" class=\"" + ((i == page) ? "paging-active" : "paging-normal") + "\">" + i + "</a>";
        }

        html += "</span>";
        html += "&nbsp;&nbsp;&nbsp;";
        html += "<img id=\"btn_go_next\"      class=\"paging-button\" src=\"/resource/images/community-button-paging-next.gif\" />&nbsp;";
        html += "<img id=\"btn_go_next_page\" class=\"paging-button\" src=\"/resource/images/community-button-paging-next-page.gif\" />&nbsp;&nbsp;&nbsp;";
        html += "<img id=\"btn_go_last\"      class=\"paging-button\" src=\"/resource/images/community-button-paging-last.gif\" />";
    }

    $(targetObj).html(html);
    $(targetObj).find("*[id^='btn_go_']").click(function() {
        var pageIndicator = $(this).attr("id").replace("btn_go_", "");

        st = parseInt(st);
        page = parseInt(page);
        total = parseInt(total);
        ed = parseInt(ed);

        switch (pageIndicator) {
            case "first":
                pageIndicator = 1;
                break;

            case "prev_page":
                pageIndicator = (st > 1) ? st - 1 : 1;
                break;

            case "prev":
                pageIndicator = (page > 1) ? page - 1 : 1;
                break;

            case "next":
                pageIndicator = (page < total) ? page + 1 : page;
                break;

            case "next_page":
                pageIndicator = (ed < total) ? ed + 1 : Math.min(ed, total);
                break;

            case "last":
                pageIndicator = total;
                break;
        }

        callback(pageIndicator);
    });
}